﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using WebApplication1.Business;

namespace WebApplication1
{
    public partial class WebForm4 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ButtonUpload_Click(object sender, EventArgs e)
        {
            ImagesBusiness ib = new ImagesBusiness();
            HttpFileCollection httpFileCollection = Request.Files;       
            for (int i = 0; i < httpFileCollection.Count; i++)
           {
                HttpPostedFile httpPostedFile = httpFileCollection[i];
                string urls = Server.MapPath("~/OrderImages/") + System.IO.Path.GetFileName(httpPostedFile.FileName);
                if (httpPostedFile.ContentLength > 0)
                 {
                    httpPostedFile.SaveAs(urls);
                    ib.UploadImages(urls.ToString(), Session["user"].ToString()); 
                }
               
            }

        }
    }
}
